﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Zack.Commons;

namespace Commons.ASPNETCore
{
    class ModuleInitializer : IModuleInitializer
    {
        public void Initialize(IServiceCollection services)
        {
            services.AddMemoryCache();
            services.AddScoped<IMemoryCacheHelper, MemoryCacheHelper>();
            // 注册为单例
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            // 注册Cookie操作接口
            services.AddSingleton<ICookieHelper, CookieHelper>();
        }
    }
}
